from datetime import datetime

#datetime.now(),用于获得当前时间，精确到微秒
today=datetime.now()
print(today)

#datetime.utcnow(),获得当前日期和时间的UTC（世界标准时间）
today=datetime.utcnow()
print(today)

#datetime (year, month, day, hour=0, minute=0，second=0, microsecond=0),创造一个日期
today=datetime(2024, 6, 24, 0, 0, 0, 0)
print(today)

#用下列网站来搜索更多内容
#https://blog.csdn.net/weixin_62511863/article/details/124546626

print(today.isoformat())#采用 ISO 8601 标准显示时间
print(today.isoweekday())#返回日期的星期

#strftime(),以任何格式来输出时间
today = datetime.now()
print(today.strftime("%Y-%m-%d %H : %M : %S"))
print(today.strftime("%x %X"))


